#include <cstring>
#include <memory>
#include <cctype>
#include <cstdio>
#include "mystring.hpp"

char *getword(char *&s) {
	while ((*s)!=0 && isspace(*s)) s++;
	if ((*s)==0) return "";
	char *t=s;
	while (!isspace(*s) && (*s)!=0) s++;
	char *res=new char[s-t+1];
	memcpy(res,t,(s-t)*sizeof(char));
	res[s-t]=0;
	printf("Getword: '%s'\n",res);
	return res;
}

int atoi(char *s) {
	int res=0;
	for (int i=0;s[i];i++) res=res*10+s[i]-'0';
	return res;
}
